package com.pks.autoInsurance.helper;

import java.util.List;

import com.pks.autoInsurance.dao.AdminDAO;
import com.pks.autoInsurance.dao.AdminDAOImpl;
import com.pks.autoInsurance.dto.PersonalDetailsDto;
import com.pks.autoInsurance.dto.VehicleDetailsDto;

public class AdminHelper {
	/*
	 * Retrives users list to the admin
	 */
	public List<PersonalDetailsDto> getUsersList() {
		System.out.println(getClass() + "::::getUsersList::::begin");
		AdminDAO adminDAO = new AdminDAOImpl();
		List<PersonalDetailsDto> userpersonalDetailsList = adminDAO
				.getUsersList();
		System.out.println(getClass() + "::::getUsersList::::end");
		return userpersonalDetailsList;
	}

	/*
	 * Retrives users list to the admin matching specific String
	 */
	public List<PersonalDetailsDto> getUsersList(String userId) {
		System.out.println(getClass() + "::::getUsersList::::begin");
		AdminDAO adminDAO = new AdminDAOImpl();
		List<PersonalDetailsDto> userpersonalDetailsList = adminDAO
				.getUsersList(userId);
		System.out.println(getClass() + "::::getUsersList::::end");
		return userpersonalDetailsList;
	}

	/*
	 * Deletes the specific user from the system
	 */
	public int deleteUser(String userId) {
		System.out.println(getClass() + "::::deleteUser::::begin");
		AdminDAO adminDAO = new AdminDAOImpl();
		System.out.println(getClass() + "::::deleteUser::::end");
		return adminDAO.deleteUser(userId);
	}

	/*
	 * Get details about the vehicle of the specific user
	 */
	public VehicleDetailsDto getUserVehicleDetail(String userId) {
		System.out.println(getClass() + "::::getUserVehicleDetail::::begin");
		AdminDAO adminDAO = new AdminDAOImpl();
		System.out.println(getClass() + "::::getUserVehicleDetail::::end");
		return adminDAO.getUserVehicleDetail(userId);
	}

	/*
	 * Updates vehicle info of particular user
	 */
	public int updateUser(VehicleDetailsDto vehicleDetailsDtoReq) {
		System.out.println(getClass() + "::::updateUser::::begin");
		return new AdminDAOImpl().updateUser(vehicleDetailsDtoReq);
	}

}
